﻿using DomainService.IService;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Utility.Enum;

namespace OverallAuth_WebApi.Controllers
{
    /// <summary>
    /// 系统模块
    /// </summary>
    [ApiController]
    [Route("api/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = nameof(ModeuleGroupEnum.SysMenu))]
    public class SysMenuController : BaseController
    {

        #region 构造实列化

        /// <summary>
        /// 菜单服务服务
        /// </summary>
        public ISysMenuService _sysMenuService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="sysMenuService"></param>
        public SysMenuController(ISysMenuService sysMenuService)
        {
            _sysMenuService = sysMenuService;
        }

        #endregion

        /// <summary>
        /// 获取所有模块
        /// </summary>
        [HttpGet]
        public void GetAllMenu() { }

        /// <summary>
        /// 获取指定模块
        /// </summary>
        /// <param name="Id">模块id</param>
        [HttpGet]
        public void GetMenuById(string Id)
        {
            _sysMenuService.GetMenuById("1");
        }

        /// <summary>
        /// 验证jwt
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Authorize]
        public string CheckJwt()
        {
            return "成功";
        }

        /// <summary>
        /// 不验证jwt
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Authorize]
        public string UnCheckJwt()
        {
            return "成功";
        }

    }
}
